<title>用户管理</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>ucentre</cite></a>
    <a><cite>用户管理</cite></a>
  </div>
</div>

<div class="layui-fluid">
  <div class="layui-card">
    <form class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="J_ajaxForm">
      <div class="layui-form-item">
        <div class="layui-inline">
          <label class="layui-form-label">ID</label>
          <div class="layui-input-block">
            <input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">用户名</label>
          <div class="layui-input-block">
            <input type="text" name="username" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">邮箱</label>
          <div class="layui-input-block">
            <input type="text" name="email" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>
            
            <div class="layui-inline">
            <label class="layui-form-label">时间</label>
            <div class="layui-input-inline" style="width: 100px;">
              <input type="text" name="time_min" placeholder="" autocomplete="off" class="layui-input J_dataTime">
            </div>
            <div class="layui-form-mid">-</div>
            <div class="layui-input-inline" style="width: 100px;">
              <input type="text" name="time_max" placeholder="" autocomplete="off" class="layui-input J_dataTime">
            </div>
          </div>
          
        <div class="layui-inline">
          <input type="button" class="layui-btn" lay-submit lay-filter="J_form_search" value="搜索">
        </div>
      </div>
    </form>
    
    <div class="layui-card-body">
      <div style="padding-bottom: 10px;">
        <a href="#J_popup_add" class="layui-btn J_popup" title="添加用户"><i class="layui-icon layui-icon-add-circle"></i>添加</a>
        <a href="ucentre/user/remove" class="layui-btn J_req" title="确定要删除吗？"><i class="layui-icon layui-icon-delete"></i>删除</a>
      </div>
      
      <table id="J_table_list" lay-filter="J_table_list"></table>

    </div>
  </div>
</div>

<script type="text/html" id="J_popup_add">
<form class="layui-form" lay-filter="J_ajaxForm_info" action="{:url('ucentre/user/add')}" method="post">

            <div class="layui-form-item">
              <label class="layui-form-label">用户名</label>
              <div class="layui-input-inline">
                <input type="text" name="username" value="" lay-verify="required" autocomplete="off" class="layui-input">
              </div>
            </div>
            
            <div class="layui-form-item">
              <label class="layui-form-label">密码</label>
              <div class="layui-input-inline">
                <input type="password" name="password" value="" lay-verify="required|password" autocomplete="off" class="layui-input">
              </div>
            </div>
 
             <div class="layui-form-item">
              <label class="layui-form-label">邮箱</label>
              <div class="layui-input-inline">
                <input type="text" name="email" value="" lay-verify="required|email" autocomplete="off" class="layui-input">
              </div>
            </div>
          
            <div class="layui-form-item">
              <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="J_ajax_submit_btn"><i class="layui-icon layui-icon-ok-circle"></i>提交</button>
              </div>
            </div>
            
          </form>
</script>

<script type="text/html" id="J_table_tool">
  <a href="ucentre/user/edit" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="popup" title="编辑用户"><i class="layui-icon layui-icon-edit"></i>编辑</a>
  <a href="ucentre/user/remove" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="req"title="确定要删除吗？"><i class="layui-icon layui-icon-delete"></i>删除</a>
</script>

<script>
;!function(){
  var $ = layui.$
  ,laydate = layui.laydate
  ,table = layui.table;

	//时间同时绑定多个
    lay('.J_dataTime').each(function(){
      laydate.render({
        elem: this
      });
    });
    
  //执行渲染
table.render({
  elem: '#J_table_list'
  ,url: '{:url('ucentre/user/list')}'
  ,cols: [[
      {type: 'checkbox'}
      ,{field:'id',title:'ID',width:80,align:'center',sort: true}
      ,{field:'username',title:'用户名',minWidth:150}
      ,{field:'email',title:'邮箱',minWidth:200}
      ,{field:'mobile',title:'手机号',minWidth:170}
      ,{field:'create_time',title:'注册时间',width:200}
      ,{title:'操作',width:150,align:'center',toolbar:'#J_table_tool'}
  ]]
  ,page: true
  ,limit: 20
  ,height: 'auto'
  ,text: {
    none: '暂无数据！'
  }
});

}();
</script>